#pragma once

#include "comm/my_conf_base.h"
#include "comm/my_cleanup.h"

typedef struct {
    my_conf_item_t                  nevents;
    my_conf_item_t                  worker_threads;
    my_conf_item_t                  worker_affinity;
    my_conf_item_t                  worker_mem_pool_water_level;
    my_conf_item_t                  accept_threads;
    my_conf_item_t                  g_mem_pool_water_level;
    my_conf_item_t                  g_aligned_mem_pool_water_level;
} my_service_conf_t;

typedef struct {
    my_conf_item_t                  listen_addr;
    my_conf_item_t                  scheme;
    my_conf_item_t                  backlog;
    my_conf_item_t                  tcp_nodelay;
    my_conf_item_t                  tcp_quicack;
    my_conf_item_t                  reuseport;
    my_conf_item_t                  reuseaddr;
    my_conf_item_t                  ipv6only;
} my_http_listener_conf_t;

typedef struct {
    my_conf_item_t                  request_header_buf_size;
    my_conf_item_t                  max_request_header_size;
    my_conf_item_t                  response_header_buf_size;
    my_conf_item_t                  max_response_header_buf_size;
    my_conf_item_t                  read_request_header_timeout_ms;
    my_conf_item_t                  read_response_header_timeout_ms;

    int64_t                         n_listeners;
    my_http_listener_conf_t         *listeners;
} my_http_conf_t;

typedef struct {
    my_service_conf_t               service_conf;
    my_http_conf_t                  http_conf;

    unsigned                        inited:1;     
} my_cache_conf_t;

void my_http_listener_conf_init(my_http_listener_conf_t *cfg);

void my_cache_conf_init();

my_cache_conf_t *my_cache_conf_get();